<?php

namespace App\Http\Requests\V3_2_7;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class LocationOutInStorageRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'location_ids'=>'required',
            'req_type'=>['required',Rule::in([0,1])],
        ];
    }

    /**
     * 验证错误信息.
     *
     * @return array
     */
    public function messages(): array
    {
        return [
            'req_type.required' => '类型参数，必传！',
            'req_type.in' => '类型参数错误！',
            'location_ids.required' => '库位主键，必传！',
        ];
    }
}
